﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MVCDemo.Web.Areas.Member.Models
{
    public class RegisterViewModel
    {
        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage="必填")]
        [StringLength(20,MinimumLength =4,ErrorMessage = "{2}到{1}个字符")]
        [Display(Name ="用户名")]
        public string UserName { get; set; }
        /// <summary>
        /// 显示名
        /// </summary>
        [Required(ErrorMessage ="必填")]
        [StringLength(20,MinimumLength =2,ErrorMessage = "{2}到{1}个字符")]
        [Display(Name ="显示名")]
        public string DisplayName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage ="必填")]
        [Display(Name="密码")]
        [StringLength(20,MinimumLength =6,ErrorMessage = "{2}到{1}个字符")]
        [DataType(DataType.Password)]
        public string Password { get; set; }
        /// <summary>
        /// 确认密码
        /// </summary>
        [Required(ErrorMessage ="必填")]
        [Compare("Password",ErrorMessage ="两次输入的密码不一致")]
        [Display(Name ="确定密码")]
        [DataType(DataType.Password)]
        public string ConfirmPassword { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        [Required(ErrorMessage ="必填")]
        [Display(Name ="邮箱")]
        [DataType(DataType.EmailAddress,ErrorMessage ="Email格式不正确")]
        public string Email { get; set; }
        /// <summary>
        /// 验证码
        /// </summary>
        [Required(ErrorMessage ="必填")]
        [StringLength(6,MinimumLength =6,ErrorMessage ="验证码不正确")]
        [Display(Name ="验证码")]
        public string VerificationCode { get; set; }
    }
}